package com.tools.common.enums;

import lombok.Getter;

@Getter
public enum NodeTypeEnum {
    START("START", "开始节点"),
    TASK("TASK", "任务节点"),
    CONDITION("CONDITION", "条件节点"),
    END("END", "结束节点");

    private final String code;
    private final String desc;

    NodeTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static NodeTypeEnum getByCode(String code) {
        for (NodeTypeEnum type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}